<table style="border: #000 1px solid">
    <tr>
        <td>Nganh hoc</td>
        <td>ID</td>
        <td>Ten Mon Hoc</td>
        <td>Trang thai</td>
    </tr>
    <?php foreach ($result as $row):?>
    <tr>
        <td><?=$row['TenNganhHoc'];?></td>
        <td><?=$row['id'];?></td>
        <td><?=$row['TenMonHoc'];?></td>
        <td><?php if ($row['anhien']==0) echo "An"; 
                  else echo "Hien";?>
        </td>
    </tr>
    <?php endforeach;?>
</table>
<h1> Create </h1>
<?php echo form_open('monhoc/create')?>
    <label for="name">Ten Mon Hoc</label>
    <input name="name" type="text">
    <label for="id_nganh">Chon nganh</label>
    <select name="id_nganh">
        <?php foreach ($Nganh as $row):?> 
            <option value="<?php echo $row['id'];?>"><?php echo $row['TenNganhHoc'];?></option>
        <?php endforeach;?>
    </select>
    <input type="submit" value="Create">
<?php echo form_close();?>

    
<h1> Edit All</h1>
<?php echo form_open('monhoc/edit')?>
    <label for="id">ID Mon Hoc</label>
    <input name="id" type="number">
    <label for="name">Ten mon hoc</label>
    <input name="name" type="text">
    <label for="id_nganh">Chon nganh</label>
    <select name="id_nganh">
        <?php foreach ($Nganh as $row):?> 
            <option value="<?php echo $row['id'];?>"><?php echo $row['TenNganhHoc'];?></option>
        <?php endforeach;?>
    </select>
    <select name="status">
            <option value="0">An</option>
            <option value="1">Hien</option>
    </select>
    <input type="submit" value="Edit">
<?php echo form_close();?>

    
<h1> Edit Name &  Nganh</h1>
<?php echo form_open('monhoc/edit_name')?>
    <label for="id">ID Mon Hoc</label>
    <input name="id" type="number">
    <label for="name">Ten mon hoc</label>
    <input name="name" type="text">
    <label for="id_nganh">Chon nganh</label>
    <select name="id_nganh">
        <?php foreach ($Nganh as $row):?> 
            <option value="<?php echo $row['id'];?>"><?php echo $row['TenNganhHoc'];?></option>
        <?php endforeach;?>
    </select>
    <input type="submit" value="Edit">
<?php echo form_close();?>

<h1> Edit trang thai</h1>
<?php echo form_open('monhoc/edit_status')?>
    <label for="id">ID Mon Hoc</label>
    <input name="id" type="number">
    <select name="status">
            <option value="0">An</option>
            <option value="1">Hien</option>
    </select>
    <input type="submit" value="Edit">
<?php echo form_close();?>

<h1> Delete</h1>
<?php echo form_open('monhoc/delete')?>
    <label for="id">ID Mon Hoc</label>
    <input name="id" type="number">
    <input type="submit" value="Delete">
<?php echo form_close();?> 